

#include <sudoku.h>

#include <stdlib.h>
#include <stdio.h>

int main(int argc, char **argv){

  sdk_list *list = sdk_list_create();

  int i = 0;
  for ( ; i < 9; i++){
    sdk_list_add_num(list, i + 1);
  }

  sdk_list *copy = sdk_list_copy(list);

  _sdk_list_print_sum(list);
  _sdk_list_print_short_sum(list);

  for ( i = 1; i < 10; i++){
    if (sdk_list_get(list, i)){
      printf("Found num: %d\n", i);
    }
  }

  printf("Getting elements by offset:\n");
  for ( i = 0; i < sdk_list_length(list); i++){
    int val = sdk_list_get_elem(list, i)->num;
    printf("Value=%d\n", val);
  }

  sdk_list_remove_num(list, 0);
  sdk_list_remove_num(list, 1);
  sdk_list_remove_num(list, 2);
  sdk_list_remove_num(list, 3);
  sdk_list_remove_num(list, 4);
  sdk_list_remove_num(list, 5);
  sdk_list_remove_num(list, 6);
  sdk_list_remove_num(list, 7);
  sdk_list_remove_num(list, 8);
  sdk_list_remove_num(list, 9);

  _sdk_list_print_sum(list);
  _sdk_list_print_short_sum(list);
  _sdk_list_print_short_sum(copy);

  sdk_list_destroy_elems(list);
  sdk_list_destroy(list);

}
